extends "../../azurlane_ctrl/AzurItem.gd"
func init():
	.init()
	name = "[稀有]海军部火控台"
	info = "造成炮击伤害之前，清空目标机动，内置冷却5秒\n[color=#DC143C]同时装备两件时可升级[/color]"
	price = 300
	att.atk = 80
	att.spd = 0.4
	
func _connect():
	._connect()
	masCha.connect("onAtkInfo", self, "onAtkInfo")
	sys.main.connect("onBattleEnd",self,"end")

func onAtkInfo(atkInfo):
	if index <= 0 and atkInfo.atkCha == masCha and atkInfo.hitCha.team != masCha.team and atkInfo.atkType == sys.AtkType.GUN and atkInfo.hitCha.hasBuff("b_hjbhkt") == null:
		masCha.castBuff(atkInfo.hitCha, b_hjbhkt.new())
		index = 5

func upgrade():
	name = "[color=#FFFF00][史诗]海军部火控台"
	info = "造成炮击伤害之前，清空目标机动，内置冷却5秒"
	att.atk = 160
	att.spd = 0.8

func end():
	index = 0

var index = 0
func _upS():
	index -= 1

class b_hjbhkt:
	extends "../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_hjbhkt"
		buffName = "海军部火控台"
		isNegetive = true
	func _connect():
		att.dod = -masCha.att.dod


